package indi.yuluo.controller;

import indi.yuluo.entity.User;
import indi.yuluo.service.UserService;
import indi.yuluo.vo.Msg;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: yuluo
 * @CreateTime: 2022-07-19  18:46
 * @Description: TODO
 */

@RestController
public class TestController {

    @Autowired
    private UserService userService;

    @GetMapping(value = "/test", produces = "application/json;charset=utf-8")
    public String test() {

        System.out.println("进入控制器的test方法");
        return "ssm！框架";
    }

    @GetMapping(value = "/getUserById")
    public User getUserById(@RequestParam Integer id) {



        return userService.getUserById(id);
    }

}
